local CSGuildWarBattleInfo = class("CSGuildWarBattleInfo")
local CSGuildWarGuildInfo = import(".CSGuildWarGuildInfo")

function CSGuildWarBattleInfo:ctor()
 
end

function CSGuildWarBattleInfo:read(pbData, isReverse)
    if not pbData then
        return
    end
    if not isReverse then
        self._leader1 = rawget(pbData, "leader1") 
        self._leader2 = rawget(pbData, "leader2")
        self._power1 = rawget(pbData, "power1") or 0
        self._power2 = rawget(pbData, "power2") or 0
    
        self._score1 = rawget(pbData, "score1") or 0
        self._score2 = rawget(pbData, "score2") or 0
    else
        self._leader1 = rawget(pbData, "leader2")
        self._leader2 = rawget(pbData, "leader1")
        self._power1 = rawget(pbData, "power2") or 0
        self._power2 = rawget(pbData, "power1") or 0
    
        self._score1 = rawget(pbData, "score2") or 0
        self._score2 = rawget(pbData, "score1") or 0
    end
   
    self._round = rawget(pbData, "round") or ""
end

function CSGuildWarBattleInfo:getPower1()
    local power = self._power1
    if power > 10000 then
        return math.floor(power/10000).."w"
    end
    return tostring(power)
end

function CSGuildWarBattleInfo:getPower2()
    local power = self._power2
    if power > 10000 then
        return math.floor(power/10000).."w"
    end
    return tostring(power)
end

function CSGuildWarBattleInfo:getScore1()
    return self._score1
end

function CSGuildWarBattleInfo:getScore2()
     return self._score2
end

function CSGuildWarBattleInfo:getLeader1()
    return self._leader1
end

function CSGuildWarBattleInfo:getLeader2()
     return self._leader2
end

function CSGuildWarBattleInfo:getRound()
    return self._round
end


return CSGuildWarBattleInfo